﻿-List<TaskPeriod> periods = null
-if (ViewData.ContainsKey("periods"))
  -periods = ViewData["periods"] as List<TaskPeriod>
-if (periods != null && periods.Count > 0)
  %ul
    -foreach(TaskPeriod tp in periods)
      %li
        %a{class=String.Format("{0} {1}","p",(tp.IsFree) ? "greenbg" : "redbg"),href="#",onclick=(tp.IsFree) ? String.Format("return setPeriodTime('{0}','{1}');",tp.StartTimeStr, tp.EndTimeStr) : "return false;"}=tp.StartTimeStr
-else
    .error.nowrap=(ViewData.ContainsKey("currentDate")) ? String.Format("{0} - нерабочий день", ViewData["currentDate"] as string) : "Выбранная дата - нерабочий день."

    
  